//
//  ReadingDetailStandCell.m
//  SunXi
//
//  Created by dllo on 15/11/30.
//  Copyright © 2015年 大远. All rights reserved.
//

#import "ReadingDetailStandCell.h"

@implementation ReadingDetailStandCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}


- (void)create{
    self.view = [[UIView alloc] init];
    [self addSubview:self.view];
    
    self.labelTitle = [[UILabel alloc] init];
    [self addSubview:self.labelTitle];
    self.labelTitle.font = [UIFont systemFontOfSize:20 weight:15];
    
    self.labelDetail = [[UILabel alloc] init];
    [self addSubview:self.labelDetail];
    self.labelDetail.numberOfLines = 0;
    self.labelDetail.font = [UIFont systemFontOfSize:15];
    self.labelDetail.textColor = [UIColor grayColor];
    
//    self.view.layer.borderWidth = 1;
//    self.labelTitle.layer.borderWidth = 1;
//    self.labelDetail.layer.borderWidth = 1;
   
}



- (void)layoutSubviews{
    
    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.and.left.and.bottom.and.right.equalTo(self).insets(UIEdgeInsetsMake(HT / 100 * 5, WH / 100, HT / 100 * 5, WH / 100));
    }];
    
    [self.labelTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).with.offset(0);
        make.left.equalTo(self.view).with.offset(0);
        make.bottom.equalTo(self.labelDetail.mas_top).with.offset(0);
        make.right.equalTo(SV).with.offset(0);
        make.height.equalTo(@(45));
    }];
    [self.labelDetail mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labelTitle.mas_bottom).with.offset(0);
        make.left.equalTo(self.view).with.offset(0);
        make.bottom.equalTo(SV).with.offset(0);
        make.right.equalTo(SV).with.offset(0);
    }];
     self.view.backgroundColor = [UIColor whiteColor];
    
    
}


- (void)setModel:(ReadingDetailModel *)model{
    
    if (_model != model) {
        self.labelTitle.text = model.title;
        self.labelDetail.text = model.content;
    }
}



@end





